<template name='user'>
  <view>

    <view class="" style="background-image: linear-gradient(#C5E1F7,#fff);">
        <view class="liubai">

        </view>
        <view class="title">
            个人中心
        </view>
        <view class="topn">
                <view class="left">
                    <view class="name">
                        {{ user.realName }} <text v-if="levelInfo">{{levelInfo}}<!-- {{ user.expertRating == 1 ? '金牌餐饮咨询师' : user.expertRating == 2 ? '高级餐饮咨询师' : '餐饮咨询师' }} --></text>
                    </view>
                    <view class="dizh">
                        <view class="sex">{{ user.sex == 0 ? '男' : suer.sex == 1 ? '女' : '未知' }}</view>
                        <view class="fill">
                            <u-icon name="map-fill" color='#FEA14A' size='10'></u-icon>
                            {{ user.district ? user.district : '未知' }}
                        </view>
                    </view>
                </view>
                <view class="right">
                    <view class="img">
                        <image :src="user.wxAvatar" style="border-radius: 100%"></image>
                        <text v-if="user.isOnline">在线</text>
                        <text class="texts" v-if="!user.isOnline">离线</text>
                    </view>
        <!--            <u-icon name="arrow-right" color='#333' size='15'></u-icon>-->
                </view>
            </view>

                <view class="datum">
                    <view class="datbox">
                        <view class="num">
                            {{ user.consultingCount ? user.consultingCount : 0 }}
                        </view>
                        <view class="tit">
                           咨询人数(人次)
                        </view>
                    </view>
                    <view class="datbox datbox2">
                        <view class="num">
                            {{ user.score ? user.score : 0 }}
                        </view>
                        <view class="tit">
                           评分
                        </view>
                    </view>
                    <view class="datbox">
                        <view class="num">
                           {{ user.onlineTime ? user.onlineTime : 0 }}
                        </view>
                        <view class="tit">
                           在线时长（小时）
                        </view>
                    </view>
                </view>
                <view class="assets" @click="wallet">
                    <view class="ass">
                        <view class="assbox">
                            <view class="asstit">
                                我的资产（元）
                            </view>
                            <view class="pick">
                                {{ user.balance ? user.balance : 0.00 }}
                            </view>
                        </view>
                        <view class="assbox">
                            <view class="asstit">
                                服务收入（元）
                            </view>
                            <view class="pick">
                              {{ user.serviceIncome ? user.serviceIncome : 0.00 }}
                            </view>
                        </view>
                       <view class="assbox">
                            <view class="asstit">
                                分销收入（元）
                            </view>
                            <view class="pick">
                              {{ user.distributionIncome ? user.distributionIncome : 0.00 }}
                            </view>
                        </view>
                    </view>
                    <view class="">
                        <u-icon name="arrow-right" color='#fff' size='20'></u-icon>
                    </view>

                </view>
    </view>

    <view class="flex-row group_14">
      <image
        src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62ac1d455a7e3f03100b6468/62b188edd029820011534ee0/16558030332466756707.png"
        class="image_10"
      />
      <text class="text_26">常用功能</text>
    </view>
    <view class="grid">
      <view class="flex-col items-center grid-item" @click="dangqi">
        <image
          src="../../static/dangqi.png"
          class="image_12"
        />
        <text class="text_20">档期设置</text>
      </view>
      <view class="flex-col items-center grid-item" @click="orderss">
        <image
          src="https://project-user-resource-1256085488.cos.ap-guangzhou.myqcloud.com/62ac1d455a7e3f03100b6468/62b188edd029820011534ee0/16558225914123964931.png"
          class="image_12"
        />
        <text class="text_20">资料管理</text>
      </view>

      <view class="flex-col items-center grid-item_2" @click="toEvaluationDetail">
        <image
          src="https://project-user-resource-1256085488.cos.ap-guangzhou.myqcloud.com/62ac1d455a7e3f03100b6468/62b188edd029820011534ee0/16558225914136502782.png"
          class="image_12"
        />
        <text class="text_22">服务评价</text>
      </view>
      <view class="flex-col items-center grid-item_3"  @click="distribution()">
        <image
          src="https://project-user-resource-1256085488.cos.ap-guangzhou.myqcloud.com/62ac1d455a7e3f03100b6468/62b188edd029820011534ee0/16558225914130572355.png"
          class="image_12"
        />
        <text class="text_23">推广分销</text>
      </view>
      <view class="flex-col items-center grid-item_1" @click="wallet">
        <image
          src="https://project-user-resource-1256085488.cos.ap-guangzhou.myqcloud.com/62ac1d455a7e3f03100b6468/62b188edd029820011534ee0/16558225914130126643.png"
          class="image_12"
        />
        <text class="text_21">我的钱包</text>
      </view>
      <view class="flex-col items-center grid-item_5" @click="onClickView_11">
        <image
          src="https://project-user-resource-1256085488.cos.ap-guangzhou.myqcloud.com/62ac1d455a7e3f03100b6468/62b188edd029820011534ee0/16558225914142306407.png"
          class="image_12"
        />
        <text class="text_25">切换身份</text>
      </view>
    </view>
    <view class="flex-row group_14">
      <image
        src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62ac1d455a7e3f03100b6468/62b188edd029820011534ee0/16558030332466756707.png"
        class="image_10"
      />
      <text class="text_26">其他功能</text>
    </view>
    <view class="grid_1s">
        <view class="flex-col items-center grid-item_6" @click="help">
          <image
            src="https://project-user-resource-1256085488.cos.ap-guangzhou.myqcloud.com/62ac1d455a7e3f03100b6468/62b188edd029820011534ee0/16558225914142303658.png"
            class="image_21"
          />
          <text class="text_27 text_28">帮助中心</text>
        </view>
        <view class="flex-col items-center grid-item_6" @click="opinion">
          <image
            src="https://project-user-resource-1256085488.cos.ap-guangzhou.myqcloud.com/62ac1d455a7e3f03100b6468/62b188edd029820011534ee0/16558028846377063333.png"
            class="image_21"
          />
          <text class="text_27 text_30">意见反馈</text>
        </view>
        <button class="flex-col items-center grid-item_6" open-type="contact">
          <image
            src="../../static/kef.png"
            class="image_21"
          />
          <text class="text_27 text_30">联系客服</text>
        </button>
        <view class="flex-col items-center grid-item_6" @click="we">
          <image
            src="https://project-user-resource-1256085488.cos.ap-guangzhou.myqcloud.com/62ac1d455a7e3f03100b6468/62b188edd029820011534ee0/16558028846372383675.png"
            class="image_21"
          />
          <text class="text_27 text_31">关于我们</text>
        </view>
    </view>
  </view>
</template>

<script>
import {getadviserInfo} from '../../api/counselor.js'
  export default {
      name: 'user',
      props: {
      	cur: String,
      },
    components: {},
    data() {
      return {
          user:{}
      };
    },
    mounted() {
        let that=this
        getadviserInfo().then(res=>{
            console.log(res);
            that.user=res.data
        })
      // getPersonInfo(this.$store.state.userInfo.wxInfo.uid).then(res => {
      //   this.user = res.data
      // })
    },
    methods: {
        dangqi(){
          uni.navigateTo({
              url:'/subPackages/pages/user2/dangqi'
          })
        },
        distribution() {
        	//分销
        	uni.navigateTo({
        		url: '/pages/distribution/distribution'
        	})
        },
      toEvaluationDetail() {
        uni.navigateTo({ url: '/subPackages/pages/user2/pingjia?uid='+this.$store.state.userInfo.wxInfo.uid})
      },
      wallet(){
          uni.navigateTo({
              url:'/pages/User/wallet'
          })

      },
      orderss(){
          this.$emit('orders',2);
      },
      onClickView_11() {
        // uni.navigateTo({ url: '/pages/geren/geren' });
      let that=this
      uni.showModal({
          content: '确定要更换身份吗？',
          success: function (res) {
              if (res.confirm) {
                   that.$emit('resurl2',0);
              } else if (res.cancel) {
              }
          }
      })
      },
      opinion(){
         uni.navigateTo({
             url:'/pages/User/opinion'
         })
      },
     help(){
         uni.navigateTo({
             url:'/pages/User/help'
         })
     },
      we(){
          uni.navigateTo({
              url:'/pages/User/we'
          })
      },
    },
  };
</script>

<style scoped lang="scss">
    button::after {
      border: initial;
    }
    .topn{
        display: flex;
        justify-content: space-between;
        width: 92vw;
        margin: 40rpx auto 30rpx;
        align-items: center;
        .left{
            .name{
                display: flex;
                align-items: center;
                font-size: 38rpx;
                text{
                    color: red;
                    display: inline-block;
                    padding:2rpx 15rpx;
                    border-radius: 50rpx;
                    border: 1rpx solid red;
                    margin-left: 15rpx;
                    font-size: 20rpx;
                }
            }
            .dizh{
                margin-top: 10rpx;
                display: flex;
                align-items: center;
                font-size: 22rpx;
                color: #63667D;
                .sex{
                   padding-right: 15rpx;
                }
                .fill{
                    display: flex;
                    align-items: center;
                    margin-left: 15rpx;
                }
            }
        }
        .right{
            display: flex;
            align-items: center;
            .img{
                position: relative;
                margin-right: 20rpx;
                image{
                    width: 110rpx;
                    height: 110rpx;
                }
                text{
                    position: absolute;
                    bottom: -10rpx;
                    left: 15rpx;
                    background-color: #536EFD;
                    color: #fff;
                    display: inline-block;
                    padding: 2rpx 15rpx;
                    border-radius: 50rpx;
                    font-size: 20rpx;
                }
                .texts{
                    background-color: #eee;
                    color: #999;
                }
            }
        }
    }
    .datum{
        width:90vw;
        margin:50rpx auto 20rpx;
        display: flex;
        justify-content: space-between;
        .datbox{
            text-align: center;
            .num{
                font-size: 28rpx;
                color: #333;
                font-weight: bold;
            }
            .tit{
                color: #63667D;
                font-size: 22rpx;
                margin-top: 15rpx;
            }
        }
        .datbox2{
            padding: 0  70rpx;
            border-left: 1rpx solid #eee;
            border-right: 1rpx solid #eee;

        }
    }
    .assets{
        width: 92vw;
        padding: 35rpx;
        border-radius: 20rpx;
        background: url('@/static/backuser2.png') no-repeat center center;
        background-size: 120% 200%;
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        color: #fff;
        margin: 30rpx auto 20rpx;
        .ass{
            width: 75vw;
            display: flex;
            justify-content: space-between;
            .assbox{
                text-align: center;
                .asstit{
                    font-size: 22rpx;
                }
                .pick{
                    font-size: 28rpx;
                    font-weight: bold;
                    margin-top: 15rpx;
                   width: 100%;
                    text-overflow: ellipsis;
                    overflow: hidden;
                    white-space: nowrap;
                }
            }
        }
    }
    .liubai{
         height: var(--status-bar-height);
        width: 100%;
    }
    .title{
       text-align: center;
       padding: 15rpx 0 ;
    }
  .image_10 {
    width: 0.31rem;
    height: 0.94rem;
  }
  .image_12 {
    width: 2rem;
    height: 2rem;
  }
  .grid-item_6 {
    padding: 0.88rem 0.16rem;
    margin: 0;
  }
  .image_21 {
    width: 1.5rem;
    height: 1.5rem;
  }
  .image_3 {
    width: 0.47rem;
    height: 0.72rem;
  }
  .section_2 {
    margin-bottom: 0.13rem;
    background-color: #63667d38;
    width: 0.031rem;
    height: 1.75rem;
  }
  .text_27 {
    margin-top: 0.25rem;
  }
  .page {
    background-color: #ffffff;
    height: 100%;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .group {
    margin-left: 0.34rem;
    margin-top: -4.13rem;
    overflow-x: hidden;
    position: relative;
  }
  .grid {
    margin: 0.94rem 0.91rem 0 0.94rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    row-gap: 1rem;
    column-gap: 0.97rem;
  }
  .group_14 {
    margin-top: 1.19rem;
    padding: 0 0.97rem;
  }
  .group_15 {
    margin: 0.48rem 0 -0.33rem;
    padding: 4.83rem 0 0.33rem;
    position: relative;
  }
  .group_1 {
    padding: 10.22rem 1.16rem 8.06rem;
    overflow-x: hidden;
    height: 23.5rem;
    position: relative;
  }
  .group_13 {
    padding: 0 0.63rem;
  }
  .grid-item {
    padding: 1.41rem 0 1.63rem;
    background-color: #0d7ecd0f;
    border-radius: 0.47rem;
  }
  .grid-item_1 {
    padding: 1.44rem 0 1.56rem;
    background-color: #ffa5010f;
    border-radius: 0.47rem;
  }
  .grid-item_2 {
    padding: 1.41rem 0 1.59rem;
    background-color: #26a34c0f;
    border-radius: 0.47rem;
  }
  .grid-item_3 {
    padding: 1.48rem 0 1.63rem;
    background-color: #4866f70f;
    border-radius: 0.47rem;
  }
  .grid-item_4 {
    padding: 1.48rem 0 1.47rem;
    background-color: #f35a590f;
    border-radius: 0.47rem;
    height: 13vh;
	width: 30vw;
  }
  .grid-item_5 {
    padding: 1.45rem 0 1.5rem;
    background-color: #7549fe0f;
    border-radius: 0.47rem;
  }
  .text_26 {
    margin-left: 0.47rem;
    color: #000;
    font-size: 1rem;
    font-family: SourceHanSansCN;
    font-weight: 500;
    line-height: 0.97rem;
  }
  .grid_1 {
    height: 8.25rem;
    position: absolute;
    left: 0.27rem;
    right: 0.33rem;
    top: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }
   .grid_1s{
       width: 80vw;
       margin: 30rpx auto;
      display: flex;
      justify-content: space-between;
      align-items: center;
  }
  .text {
    color: #333333;
    font-size: 1.19rem;
    font-family: SourceHanSansCN;
    font-weight: 500;
    line-height: 1.13rem;
    position: absolute;
    left: 1.19rem;
    top: 10.22rem;
  }
  .text_1 {
    color: #63667d;
    font-size: 0.69rem;
    font-family: SourceHanSansCN;
    line-height: 0.66rem;
    position: absolute;
    left: 1.16rem;
    bottom: 11rem;
  }
  .image {
    width: 1.03rem;
    height: 0.75rem;
    position: absolute;
    left: 2.25rem;
    bottom: 10.94rem;
  }
  .text_2 {
    color: #63667d;
    font-size: 0.69rem;
    font-family: SourceHanSansCN;
    line-height: 0.66rem;
    position: absolute;
    left: 3.56rem;
    bottom: 10.97rem;
  }
  .text_3 {
    color: #333333;
    font-size: 0.88rem;
    font-family: SourceHanSansCN;
    font-weight: 500;
    line-height: 0.66rem;
    position: absolute;
    left: 2.91rem;
    bottom: 8.06rem;
  }
  .group_2 {
    overflow-x: hidden;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    position: absolute;
  }
  .text_19 {
    margin-left: 0.5rem;
    color: #000;
    font-size: 1rem;
    font-family: SourceHanSansCN;
    font-weight: 500;
    line-height: 0.94rem;
  }
  .text_20 {
    margin-top: 0.88rem;
    color: #333333;
    font-size: 0.75rem;
    font-family: SourceHanSansCN;
    line-height: 0.69rem;
  }
  .text_21 {
    margin-top: 0.88rem;
    color: #333333;
    font-size: 0.75rem;
    font-family: SourceHanSansCN;
    line-height: 0.72rem;
  }
  .text_22 {
    margin-top: 0.88rem;
    color: #333333;
    font-size: 0.75rem;
    font-family: SourceHanSansCN;
    line-height: 0.72rem;
  }
  .text_23 {
    margin-top: 0.77rem;
    color: #333333;
    font-size: 0.75rem;
    font-family: SourceHanSansCN;
    line-height: 0.72rem;
  }
  .text_24 {
    margin-top: 0.89rem;
    color: #333333;
    font-size: 0.75rem;
    font-family: SourceHanSansCN;
    line-height: 0.75rem;
  }
  .text_25 {
    margin-top: 0.92rem;
    color: #333333;
    font-size: 0.75rem;
    font-family: SourceHanSansCN;
    line-height: 0.72rem;
  }
  .image_20 {
    margin-left: 11.25rem;
    width: 0.31rem;
    height: 0.094rem;
  }
  .section_1 {
    margin-left: 5.94rem;
    padding: 5.69rem 2.44rem 6.84rem;
    background-image: url('https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62ac1d455a7e3f03100b6468/62b188edd029820011534ee0/16558225856642705968.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    width: 23.5rem;
  }
  .image_5 {
    width: 96.9333vw;
    height: 2.6667vw;
    position: absolute;
    left: 0;
    right: 0.38rem;
    top: 4.41rem;
  }
  .text-wrapper_1 {
    padding: 0.13rem 0 0.22rem;
    background-color: #e65943;
    border-radius: 0.5rem;
    position: absolute;
    left: 5.09rem;
    top: 10.31rem;
    border: solid 0.031rem #e65943;
  }
  .text_11 {
    color: #63667d;
    font-size: 0.69rem;
    font-family: SourceHanSansCN;
    line-height: 0.75rem;
    position: absolute;
    left: 1.72rem;
    bottom: 6.75rem;
  }
  .text_12 {
    color: #63667d;
    font-size: 0.69rem;
    font-family: SourceHanSansCN;
    line-height: 0.66rem;
    position: absolute;
    left: 5.22rem;
    bottom: 11rem;
  }
  .image_6 {
    width: 93.7333vw;
    height: 15.0667vw;
    position: absolute;
    left: 0.41rem;
    right: 0.72rem;
    bottom: 1.03rem;
  }
  .section_3 {
    padding: 0.47rem 0 0.88rem;
    border-radius: 0.47rem;
    background-image: url('https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62ac1d455a7e3f03100b6468/62b188edd029820011534ee0/16558225856696885152.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    position: absolute;
    left: 0.59rem;
    right: 0.94rem;
    top: 17.66rem;
  }
  .image_9 {
    border-radius: 0.42rem;
    width: 2.03rem;
    height: 2.09rem;
    position: absolute;
    right: 9.63rem;
    bottom: 1.53rem;
  }
  .text_18 {
    color: #ffffff;
    font-size: 0.88rem;
    font-family: SourceHanSansCN;
    font-weight: 500;
    line-height: 0.66rem;
    position: absolute;
    left: 8.88rem;
    bottom: 2.88rem;
  }
  .text_28 {
    color: #2f356f;
    font-size: 0.63rem;
    font-family: SourceHanSansCN;
    line-height: 0.59rem;
  }
  .text_29 {
    color: #2f356f;
    font-size: 0.63rem;
    font-family: SourceHanSansCN;
    line-height: 0.59rem;
  }
  .text_30 {
    color: #2f356f;
    font-size: 0.63rem;
    font-family: SourceHanSansCN;
    line-height: 0.59rem;
  }
  .text_31 {
    color: #2f356f;
    font-size: 0.63rem;
    font-family: SourceHanSansCN;
    line-height: 0.59rem;
  }
  .text_32 {
    color: #9dabc0;
    font-size: 0.63rem;
    font-family: SourceHanSansCN;
    line-height: 0.59rem;
  }
  .text_33 {
    color: #9dabc0;
    font-size: 0.63rem;
    font-family: SourceHanSansCN;
    line-height: 0.59rem;
  }
  .text_34 {
    color: #9dabc0;
    font-size: 0.63rem;
    font-family: SourceHanSansCN;
    line-height: 0.59rem;
  }
  .text_35 {
    color: #6d79fe;
    font-size: 0.63rem;
    font-family: SourceHanSansCN;
    line-height: 0.59rem;
  }
  .group_3 {
    padding: 0 0.84rem;
  }
  .group_4 {
    margin-top: 2.06rem;
  }
  .text_10 {
    margin-left: 0.38rem;
    margin-right: 0.31rem;
    color: #e65943;
    font-size: 0.63rem;
    font-family: SourceHanSansCN;
    line-height: 0.63rem;
  }
  .group_10 {
    width: 5.38rem;
    position: relative;
  }
  .text_15 {
    margin-left: 2.47rem;
    margin-top: 0.63rem;
    color: #ffffff;
    font-size: 0.69rem;
    font-family: SourceHanSansCN;
    line-height: 0.66rem;
  }
  .group_11 {
    margin-left: 2.13rem;
    margin-top: 0.63rem;
  }
  .text_4 {
    align-self: center;
    color: #000;
    font-size: 1.06rem;
    font-family: SourceHanSansCN;
    font-weight: 500;
    line-height: 1rem;
  }
  .image_1 {
    margin-left: 3.41rem;
    margin-right: 4.09rem;
    border-radius: 0.94rem;
    width: 5.19rem;
    height: 1.88rem;
  }
  .group_7 {
    margin-top: 1.34rem;
  }
  .image_7 {
    border-radius: 0.42rem;
    width: 2.75rem;
    height: 2.72rem;
  }
  .text_13 {
    color: #ffffff;
    font-size: 0.69rem;
    font-family: SourceHanSansCN;
    line-height: 0.66rem;
    position: absolute;
    right: 0;
    top: 0.69rem;
  }
  .text_14 {
    color: #ffffff;
    font-size: 0.88rem;
    font-family: SourceHanSansCN;
    font-weight: 500;
    line-height: 0.66rem;
    position: absolute;
    right: 0.69rem;
    bottom: 0.22rem;
  }
  .image_8 {
    margin-left: 1.69rem;
    margin-top: 1.16rem;
  }
  .group_6 {
    margin-left: 8.81rem;
    padding-bottom: 0.38rem;
    width: 3.44rem;
    position: relative;
  }
  .image_4 {
    margin-left: 0.72rem;
    margin-right: 5.19rem;
    align-self: center;
  }
  .group_8 {
    width: 5.56rem;
  }
  .group_9 {
    margin-right: 3.88rem;
    width: 9.13rem;
  }
  .text_16 {
    color: #ffffff;
    font-size: 0.69rem;
    font-family: SourceHanSansCN;
    line-height: 0.66rem;
  }
  .text_17 {
    margin-top: 0.56rem;
    color: #ffffff;
    font-size: 0.88rem;
    font-family: SourceHanSansCN;
    font-weight: 500;
    line-height: 0.66rem;
  }
  .image_2 {
    width: 3.44rem;
    height: 3.44rem;
  }
  .text-wrapper {
    padding: 0.19rem 0;
    background-color: #536efd;
    background-image: linear-gradient(-45deg, #6d79fe 0%, #7d88ff 100%);
    border-radius: 0.47rem;
    width: 2.13rem;
    position: absolute;
    top: 2.84rem;
    left: 50%;
    transform: translateX(-50%);
  }
  .text_6 {
    color: #333333;
    font-size: 0.88rem;
    font-family: SourceHanSansCN;
    font-weight: 500;
    line-height: 0.66rem;
  }
  .text_7 {
    margin-top: 0.59rem;
    color: #63667d;
    font-size: 0.69rem;
    font-family: SourceHanSansCN;
    line-height: 0.63rem;
  }
  .text_8 {
    color: #333333;
    font-size: 0.88rem;
    font-family: SourceHanSansCN;
    font-weight: 500;
    line-height: 0.66rem;
  }
  .text_9 {
    margin-top: 0.56rem;
    color: #63667d;
    font-size: 0.69rem;
    font-family: SourceHanSansCN;
    line-height: 0.66rem;
  }
  .text_5 {
    color: #fffffe;
    font-size: 0.63rem;
    font-family: SourceHanSansCN;
    line-height: 0.59rem;
  }
</style>
